package com.jet.chat.q;
import java.io.IOException;
import java.io.ObjectInputStream;


public class T implements Runnable {
	
	private ObjectInputStream reader;

	public T(ObjectInputStream reader) {
		this.reader = reader;
	}
	
	@Override
	public void run() {
		try {
			while (!Thread.interrupted()) {
				NotMessage message = (NotMessage) reader.readObject();
				System.out.println(message.getMessage());
				//System.out.println(Thread.interrupted());
				if (Thread.interrupted()) {
					System.out.println("yo!");
					break;
				}
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.println("t1 done");
	}

}
